import request from '@/utils/request';

const api = '/api/useraccount';

export async function get() {
  return request('/api/useraccount');
}

export async function getCurrent(savedId) {
  return request(`/api/useraccount/${savedId}`);
}

export async function accountLogin(params) {
  return request('/api/userAccount/login', {
    method: 'POST',
    body: params,
  });
}

export async function createAccount(params) {
  return request(api, {
    method: 'POST',
    body: params,
  });
}

export async function updateAccountInfo(params) {
  return  request(`${api}/${params.id}`, {
    method: 'PUT',
    body: params,
  });
}
